﻿using AyaWo.DAL;
using AyaWo.DbF;
using BellesLettres;
using Qbqqban;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using XiuLetters;
using YuLe163Hot;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        DateTime ToDate(string data)
        {
            if (data == null)
                return DateTime.Now;
            DateTime result;
            return DateTime.TryParse(data.ToString(), out result) ? result : DateTime.Now;
        }

        private void button1_Click(object sender, EventArgs e)
        {

            //  var mysqlDbH = new DbHelper("server=122.112.229.171;user id=ContentDb ;password=ContentDb123!@#;database=contentdb;charset=utf8", SqlSourceType.MySql);
            //  var sqliteDbH = new DbHelper("data source=|DataDirectory|AyaDB.db;Pooling=true;FailIfMissing=false", SqlSourceType.SqLite);
            //  string sqlStr = "update blogeasay set CreatedDate=@CreatedDate where title=";
            //var sqliteLitspidercontent = sqliteDbH.GetList<spidercontent>(new { }).Where(x => x.HasTonbu == 1).ToList();
            //  var mysqlLitBlogEasay = mysqlDbH.GetList<BlogEasay>(new { });
            //  foreach (var t in mysqlLitBlogEasay)
            //  {
            //      foreach (var y in sqliteLitspidercontent)
            //      {
            //          if (t.title == y.Title)
            //          {
            //              mysqlDbH.ExecuteBySql(new StringBuilder(sqlStr+"'"+ t.title + "'"), new { CreatedDate = ToDate(y.BuildTime) });
            //          }
            //      }
            //      }

            //BellesLettresSpler ctx = new BellesLettresSpler();
            //ctx.Initiali();

            //XiuLettersSpler ctx = new XiuLettersSpler();
            //ctx.Initiali();

            //YuLe163HotSpler ctx = new YuLe163HotSpler();
            //        ctx.Initiali();

            QbqqbanAuto ctx = new QbqqbanAuto();
            ctx.Initiali();

        }
    }
}
